package main

import "fmt"

func main() {

	var p IPerson
	p = &Student{}

	p.sayHello()
	p.masturbation()


	p = &Teacher{}

	p.sayHello()
	p.masturbation()

	//超集可以转换为子集,反过来不行
	var h Humaner = p


	fmt.Println(h)

	h.masturbation()



}

//定义接口类型
type Humaner interface {

	masturbation()
}

//定义接口类型
type IPerson interface {
	sayHello()

	Humaner
}

type Student struct {
	id   int64
	name string
}

type Teacher struct {
	id   int64
	name string
}
type AAA struct {
	id   int64
	name string
}

func (student *Student) sayHello() () {

	fmt.Println("Student : -->> Hello!")
}

func (teacher *Teacher) sayHello() () {

	fmt.Println("Teacher : -->> Hello!")
}


func (student *Student) masturbation() () {

	fmt.Println("Student : -->> sasturbation!")
}

func (teacher *Teacher) masturbation() () {

	fmt.Println("Teacher : -->> sasturbation!")
}

